import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2025-03-11
 * Time: 22:07
 */
public class test2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int x =scanner.nextInt();
        int[] arr = new int[n];
        for(int i=0;i<n;i++){
            arr[i] = scanner.nextInt();
        }
      //找到数组中最大的数
        int max = arr[0];
        int j=0;
        for(int i=0;i<n;i++){
            if(arr[i]>max){
                max = arr[i];
                j=i;
            }
        }
        int left = j;
        int right = j;


        while (max<x){
            int minx=0;
            if(j<n-1){
                 minx=Math.min(arr[j-1],arr[j+1]);
                if(max+minx<x){
                    max+=Math.max(arr[j-1],arr[j+1]);
                    right=j+1;
                }else {
                    max+=minx;
                    left=j-1;
                }
            }else {
                max+=arr[j-1];
            }

        }
        System.out.println(left+" "+right);

    }
}
